package com.banshuibao.bsb_android.util;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;

import com.banshuibao.bsb_android.Constants;
import com.banshuibao.bsb_android.MyApplication;
import com.banshuibao.bsb_android.activity.*;
import com.banshuibao.bsb_android.activity.AboutUsActivity;
import com.banshuibao.bsb_android.activity.AccountantDetailActivity;
import com.banshuibao.bsb_android.activity.AccountantSearchActivity;
import com.banshuibao.bsb_android.activity.AdditionalEditActivity;
import com.banshuibao.bsb_android.activity.AdditionalEditRecordActivity;
import com.banshuibao.bsb_android.activity.AdditionalRecorderActivity;
import com.banshuibao.bsb_android.activity.AdoptActivity;
import com.banshuibao.bsb_android.activity.AnswerTabActivity;
import com.banshuibao.bsb_android.activity.AnswerTobeActivity;
import com.banshuibao.bsb_android.activity.ApplyToExpertActivity;
import com.banshuibao.bsb_android.activity.ApplyToExpertTwoActivity;
import com.banshuibao.bsb_android.activity.AreaIdActivity;
import com.banshuibao.bsb_android.activity.BalanceActivity;
import com.banshuibao.bsb_android.activity.BitmapShowActivity;
import com.banshuibao.bsb_android.activity.BuyMediaListActivity;
import com.banshuibao.bsb_android.activity.CalendarActivity;
import com.banshuibao.bsb_android.activity.CaseActivity;
import com.banshuibao.bsb_android.activity.CashListActivity;
import com.banshuibao.bsb_android.activity.CheckInActivity;
import com.banshuibao.bsb_android.activity.CheckOkActivity;
import com.banshuibao.bsb_android.activity.CoachExpertDetailActivity;
import com.banshuibao.bsb_android.activity.CoachInterpretationActivity;
import com.banshuibao.bsb_android.activity.CoachListActivity;
import com.banshuibao.bsb_android.activity.CoachPolicyDetailActivity;
import com.banshuibao.bsb_android.activity.CoachQasDetailActivity;
import com.banshuibao.bsb_android.activity.CommitAnswerActivity;
import com.banshuibao.bsb_android.activity.CommonActivity;
import com.banshuibao.bsb_android.activity.CommonUserHomeActivity;
import com.banshuibao.bsb_android.activity.ConDetailsActivity;
import com.banshuibao.bsb_android.activity.ConsultingOfficeActivity;
import com.banshuibao.bsb_android.activity.CounselorUserHomeActivity;
import com.banshuibao.bsb_android.activity.CounterActivity;
import com.banshuibao.bsb_android.activity.DataQueryActivity;
import com.banshuibao.bsb_android.activity.DataQueryListActivity;
import com.banshuibao.bsb_android.activity.DealActivity;
import com.banshuibao.bsb_android.activity.EventListActivity;
import com.banshuibao.bsb_android.activity.EventMediaPlayerActivity;
import com.banshuibao.bsb_android.activity.ExpertAnswerDetailsActivity;
import com.banshuibao.bsb_android.activity.ExpertRecorderDataileActivity;
import com.banshuibao.bsb_android.activity.ExpertUserHomeActivity;
import com.banshuibao.bsb_android.activity.ExpertsAnswerActivity;
import com.banshuibao.bsb_android.activity.FilePickerActivity;
import com.banshuibao.bsb_android.activity.GoodsDetailActivity;
import com.banshuibao.bsb_android.activity.GuidePageActivity;
import com.banshuibao.bsb_android.activity.HelpActivity;
import com.banshuibao.bsb_android.activity.HelpDetailActivity;
import com.banshuibao.bsb_android.activity.InterviewListActivity;
import com.banshuibao.bsb_android.activity.InvitCodeActivity;
import com.banshuibao.bsb_android.activity.InviteMembersActivity;
import com.banshuibao.bsb_android.activity.InviteRecordActivity;
import com.banshuibao.bsb_android.activity.KnowledgeActivity;
import com.banshuibao.bsb_android.activity.KnowledgeDetailsActivity;
import com.banshuibao.bsb_android.activity.LiveDetailActivity;
import com.banshuibao.bsb_android.activity.LoginActivity;
import com.banshuibao.bsb_android.activity.MatchActivity;
import com.banshuibao.bsb_android.activity.MediaListActivity;
import com.banshuibao.bsb_android.activity.MediaPlayerActivity;
import com.banshuibao.bsb_android.activity.MenuTagActivity;
import com.banshuibao.bsb_android.activity.MenuTagResultActivity;
import com.banshuibao.bsb_android.activity.MoreDataQueryActivity;
import com.banshuibao.bsb_android.activity.MoreResultActivity;
import com.banshuibao.bsb_android.activity.MyFavoriteActivity;
import com.banshuibao.bsb_android.activity.MyVipCardActivity;
import com.banshuibao.bsb_android.activity.MyVipCardBuyActivity;
import com.banshuibao.bsb_android.activity.NewSearchActivity;
import com.banshuibao.bsb_android.activity.NoAdoptActivity;
import com.banshuibao.bsb_android.activity.NoAnswerActivity;
import com.banshuibao.bsb_android.activity.OfficeDetailActivity;
import com.banshuibao.bsb_android.activity.OfficeGoodsListActivity;
import com.banshuibao.bsb_android.activity.OfficeListActivity;
import com.banshuibao.bsb_android.activity.OfficeUserHomeActivity;
import com.banshuibao.bsb_android.activity.OneOnOneActivity;
import com.banshuibao.bsb_android.activity.PayActivity;
import com.banshuibao.bsb_android.activity.PersonalDataActivity;
import com.banshuibao.bsb_android.activity.PersonalPageActivity;
import com.banshuibao.bsb_android.activity.QuestionCloselyActivity;
import com.banshuibao.bsb_android.activity.QuickConsultationActivity;
import com.banshuibao.bsb_android.activity.RecordVideoActivity;
import com.banshuibao.bsb_android.activity.RecorderContentActivity;
import com.banshuibao.bsb_android.activity.RecorderEditActivity;
import com.banshuibao.bsb_android.activity.RecorderListActivity;
import com.banshuibao.bsb_android.activity.RecorderNonPassActivity;
import com.banshuibao.bsb_android.activity.RecorderTypeActivity;
import com.banshuibao.bsb_android.activity.ReportActivity;
import com.banshuibao.bsb_android.activity.ResetRecordVideoActivity;
import com.banshuibao.bsb_android.activity.SettingActivity;
import com.banshuibao.bsb_android.activity.SpeciaConsultActivity;
import com.banshuibao.bsb_android.activity.SystemInformationActivity;
import com.banshuibao.bsb_android.activity.TabActivity;
import com.banshuibao.bsb_android.activity.TabTwoActivity;
import com.banshuibao.bsb_android.activity.TaxSearchActivity;
import com.banshuibao.bsb_android.activity.TaxSearchDetailActivity;
import com.banshuibao.bsb_android.activity.ToAnswerListActivity;
import com.banshuibao.bsb_android.activity.ToVipActivity;
import com.banshuibao.bsb_android.activity.TobeActivity;
import com.banshuibao.bsb_android.activity.ToolsActivity;
import com.banshuibao.bsb_android.activity.UpPasswordActivity;
import com.banshuibao.bsb_android.activity.WebViewActivity;
import com.banshuibao.bsb_android.activity.WithdrawalsActivity;
import com.banshuibao.bsb_android.download.DownloadListActivity;
import com.banshuibao.bsb_android.http.HttpResponse;
import com.banshuibao.bsb_android.http.HttpUtil;
import com.banshuibao.bsb_android.model.ConsutationModel;
import com.banshuibao.bsb_android.model.ExpertRecorderDetailModel;
import com.banshuibao.bsb_android.model.IfModel;
import com.banshuibao.bsb_android.model.IsAdoptModel;
import com.banshuibao.bsb_android.model.OneModel;
import com.banshuibao.bsb_android.model.RecorderContentModel;
import com.banshuibao.bsb_android.model.TobeModel;
import com.banshuibao.bsb_android.model.UserMessageModel;

/**
 * Created by wangpan on 2017/3/20.
 */

public class IntentManager {

    /**
     * 根据角色跳转相应首页
     * 用户的角色（0 事务所用户 1解税宝用户 2 事务所管理员 3 咨询师 4 专家）
     */
    public static void goUserHomeActivity(Activity context) {
        MyApplication.applicationInstance.finishActivity(context);
        GetLoginInfo loginInfoInstance = GetLoginInfo.getLoginInfoInstance(context).readUser();
        String role = loginInfoInstance.getRole();
        Intent intent = new Intent();
        if (TextUtils.isEmpty(role)) {
            role = "";
        }
        switch (role) {
            case "0":
                intent.setClass(context, OfficeUserHomeActivity.class);
                context.startActivity(intent);
                break;
            case "":
            case "1":
                intent.setClass(context, CommonUserHomeActivity.class);
                context.startActivity(intent);
                break;
            case "2":
            case "3":
                intent.setClass(context, CounselorUserHomeActivity.class);
                context.startActivity(intent);
                break;
            case "4":
                intent.setClass(context, ExpertUserHomeActivity.class);
                context.startActivity(intent);
                break;
            default:
                intent.setClass(context, CommonUserHomeActivity.class);
                context.startActivity(intent);
                break;
        }
    }

    /**
     * 跳转到搜索页面
     */
    public static void goSearchActivity(Context context) {
        Intent intent = new Intent(context, NewSearchActivity.class);
        context.startActivity(intent);
    }

    /**
     * 搜索结果页进行详情判断
     * tag 标识
     */
    public static void goDetails(Context context, String tag) {
        Intent intent = new Intent();
        switch (tag) {
            case "1":
                //   intent.setClass(context,);
                break;
            case "2":

                break;
            case "3":

                break;
        }
        context.startActivity(intent);
    }

    /**
     * 跳转登录页面
     */
    public static void goLoginActivity(Context context) {
        Intent intent = new Intent(context, LoginActivity.class);
        context.startActivity(intent);
    }

    /**
     * 跳转支付页面
     */
    public static void goPayActivity(Context context, String content, String price, int flag) {
        Intent intent = new Intent(context, PayActivity.class);
        intent.putExtra("flag", flag);
        intent.putExtra("content", content);
        intent.putExtra("price", price);
        context.startActivity(intent);
    }

    public static void goPayResultActivity(Activity context, String content, String price, String uuid, int flag) {
        Intent intent = new Intent(context, PayActivity.class);
        intent.putExtra("flag", flag);
        intent.putExtra("content", content);
        intent.putExtra("price", price);
        intent.putExtra("uuid", uuid);
        context.startActivityForResult(intent, 200);
    }

    /**
     * 跳转抢答页面
     */
    public static void goAnswerActivity(Context context, TobeModel.DataBean item) {
        Intent intent = new Intent(context, AnswerTobeActivity.class);
        intent.putExtra("item", item);
        context.startActivity(intent);
    }

    /**
     * 跳转到同步解读详情页面
     */
    public static void goCoachInterpretationActivity(Context context, String uuid) {
        Intent it = new Intent(context, CoachInterpretationActivity.class);
        it.putExtra("uuid", uuid);
        context.startActivity(it);
    }

    /**
     * 跳转到同步解读页面
     */
    public static void goCoachPolicyDetailActivity(Context context, String uuid, String title, long time) {
        Intent it = new Intent(context, CoachPolicyDetailActivity.class);
        it.putExtra("uuid", uuid);
        it.putExtra("time", time);
        it.putExtra("title", title);
        context.startActivity(it);
    }

    /**
     * 跳转到问题解答页面
     */
    public static void goCoachQasDetailActivity(Context context, String uuid) {
        Intent it = new Intent(context, CoachQasDetailActivity.class);
        it.putExtra("uuid", uuid);
        context.startActivity(it);
    }

    /**
     * 跳转到同步解读详情页面
     */
    public static void goCoachExpertDetailActivity(Context context, String uuid) {
        Intent it = new Intent(context, CoachExpertDetailActivity.class);
        it.putExtra("uuid", uuid);
        context.startActivity(it);
    }

    /**
     * 跳转到专家问答互动页面
     */
    public static void goExpertDetailActivity(Context context, String uuid) {
        Intent it = new Intent(context, ExpertAnswerDetailsActivity.class);
        it.putExtra("uuid", uuid);
        context.startActivity(it);
    }

    /**
     * 跳转到追问页面
     */
    public static void goQuestionCloselyActivity(Context context, String uuid, double price, String tag) {
        Intent it = new Intent(context, QuestionCloselyActivity.class);
        it.putExtra("price", price);
        it.putExtra("uuid", uuid);
        it.putExtra("tag", tag);
        context.startActivity(it);
    }

    /**
     * 跳转到举报页面
     */
    public static void goReportActivity(Context context, String uuid, String title) {
        Intent it = new Intent(context, ReportActivity.class);
        it.putExtra("title", title);
        it.putExtra("uuid", uuid);
        context.startActivity(it);
    }

    /**
     * 查看图片
     */
    public static void goBitmapShowActivity(Context context, String[] images, int index) {
        Intent it = new Intent(context, BitmapShowActivity.class);
        it.putExtra("images", images);
        it.putExtra("index", index);
        context.startActivity(it);
    }

    /**
     * 跳提交答案页面
     */
    public static void goCommitAnswerActivity(Context context, IfModel.DataBean dataBean) {
        Intent it = new Intent(context, CommitAnswerActivity.class);
        it.putExtra("flag", 2);
        it.putExtra("item", dataBean);
        context.startActivity(it);
    }

    /**
     * 推送专用
     *
     * @param context
     * @param dataBean
     */
    public static void goPushCommitAnswerActivity(Context context, IfModel.DataBean dataBean) {
        Intent it = new Intent(context, CommitAnswerActivity.class);
        it.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        it.putExtra("flag", 2);
        it.putExtra("item", dataBean);
        context.startActivity(it);
    }

    /**
     * 专家答疑列表
     */
    public static void goExpertsAnswer(Context context) {
        Intent it = new Intent(context, ExpertsAnswerActivity.class);
        context.startActivity(it);
    }

    /**
     * 申请做答疑专家
     */
    public static void goApplyToExpertActivity(Context context) {
        Intent it = new Intent(context, ApplyToExpertActivity.class);
        context.startActivity(it);
    }

    /**
     * 快速咨询列表
     */
    public static void goTobeActivity(Context context) {
        Intent it = new Intent(context, TobeActivity.class);
        context.startActivity(it);
    }

    /**
     * 推送专用
     *
     * @param context
     */
    public static void goPushTobeActivity(Context context) {
        Intent it = new Intent(context, TobeActivity.class);
        it.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(it);
    }

    /**
     * 根据身份判断快速咨询跳转哪个页面
     * 0 事务所用户 1解税宝用户 2 事务所管理员 3 咨询师 4 专家
     */
    public static void goIfAnswerActivity(Context context) {
        GetLoginInfo loginInfoInstance = GetLoginInfo.getLoginInfoInstance(context).readUser();
        String cookieId = loginInfoInstance.getCookieId();
        if (!TextUtils.isEmpty(cookieId)) {
            getData(context);
        } else {
            goLoginActivity(context);
        }
    }

    /**
     * 推送专用
     *
     * @param context
     */
    public static void goPushIfAnswerActivity(Context context) {
        GetLoginInfo loginInfoInstance = GetLoginInfo.getLoginInfoInstance(context).readUser();
        String cookieId = loginInfoInstance.getCookieId();
        if (!TextUtils.isEmpty(cookieId)) {
            getPushData(context);
        } else {
            Intent intent = new Intent(context, LoginActivity.class);
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(intent);
        }
    }

    /**
     * 是否有未采纳的，有就跳采纳页，否则跳发布悬赏页
     *
     * @param context
     */
    public static void goIfAdoptActivity(Context context) {
        GetLoginInfo loginInfoInstance = GetLoginInfo.getLoginInfoInstance(context).readUser();
        String cookieId = loginInfoInstance.getCookieId();
        if (!TextUtils.isEmpty(cookieId)) {
            isAdopt(context);
        } else {
            goLoginActivity(context);
        }
    }


    //查询是否有未采纳的问题
    public static void isAdopt(final Context context) {
        GetLoginInfo loginInfoInstance = GetLoginInfo.getLoginInfoInstance(context).readUser();
        final String role = loginInfoInstance.getRole();
        HttpUtil.doPost(Constants.Url.IS_ADOPT, null, new HttpResponse(context, IsAdoptModel.class) {
            @Override
            public void onResult(Object obj) {
                IsAdoptModel s = (IsAdoptModel) obj;
                boolean data = s.isData();
                if (data) {
                    Intent intent = new Intent(context, TabActivity.class);
                    intent.putExtra("flag", 1);
                    context.startActivity(intent);
                }
            }
        });
    }

    //查询是否有未提交过的问题
    private static void getData(final Context context) {
        HttpUtil.doPost(Constants.Url.IF_CONSULTTATION, null, new HttpResponse(context, IfModel.class) {
            @Override
            public void onResult(Object obj) {
                IfModel s = (IfModel) obj;
                IfModel.DataBean data = s.getData();
                String type = s.getType();
                if (type.equals("0")) {
                    IntentManager.goCommitAnswerActivity(context, data);
                } else {
                    IntentManager.goTobeActivity(context);
                }
            }
        });
    }


    //推送专用        查询是否有未提交过的问题
    private static void getPushData(final Context context) {
        HttpUtil.doPost(Constants.Url.IF_CONSULTTATION, null, new HttpResponse(context, IfModel.class) {
            @Override
            public void onResult(Object obj) {
                IfModel s = (IfModel) obj;
                IfModel.DataBean data = s.getData();
                String type = s.getType();
                if (type.equals("0")) {
                    IntentManager.goPushCommitAnswerActivity(context, data);
                } else {
                    IntentManager.goPushTobeActivity(context);
                }
            }

            @Override
            public void onError(String code, String msg) {
              //  super.onError(code, msg);
                if(TextUtils.equals(code, Constants.Code.LOGIN_AGAIN)){
                    Intent intent = new Intent(context,LoginActivity.class);
                    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    context.startActivity(intent);
                }
            }
        });
    }

    //读取用户信息判断是否开启事务所权限  0 开启  1 没开启
    public static void isJurisdiction(final Context context) {
        HttpUtil.doPost(Constants.Url.USER_MESSAGE, null, new HttpResponse(context, UserMessageModel.class) {
            @Override
            public void onResult(Object obj) {
                UserMessageModel messageModel = (UserMessageModel) obj;
                String limit = messageModel.getData().getRapidLimit();
                if (limit.equals("0")) {
                    goTabActivity(context);
                } else if (limit.equals("1")) {
                    goOneOnOnectivity(context);
                }
            }
        });
    }

    /**
     * 推送专用
     *
     * @param context
     */
    public static void isPushJurisdiction(final Context context) {
        HttpUtil.doPost(Constants.Url.USER_MESSAGE, null, new HttpResponse(context, UserMessageModel.class) {
            @Override
            public void onResult(Object obj) {
                UserMessageModel messageModel = (UserMessageModel) obj;
                String limit = messageModel.getData().getRapidLimit();
                if (limit.equals("0")) {
                    goPushTabActivity(context);
                } else if (limit.equals("1")) {
                    goPushOneOnOnectivity(context);
                }
            }
        });
    }

    /**
     * 正常用户跳转清单咨询  显示一对一 和 悬赏
     */
    public static void goTabActivity(Context context) {
        Intent intent = new Intent(context, TabActivity.class);
        context.startActivity(intent);
    }

    /**
     * 推送专用
     *
     * @param context
     */

    public static void goPushTabActivity(Context context) {
        Intent intent = new Intent(context, TabActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    }

    /**
     * 事务所用户没开启权限跳转清单咨询  只显示一对一咨询
     */
    public static void goOneOnOnectivity(Context context) {
        Intent intent = new Intent(context, OneOnOneActivity.class);
        context.startActivity(intent);
    }

    /**
     * 推送专用
     *
     * @param context
     */
    public static void goPushOneOnOnectivity(Context context) {
        Intent intent = new Intent(context, OneOnOneActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    }

    /**
     * 跳转我的回答
     */
    public static void goTabTwoActivity(Context context) {
        Intent intent = new Intent(context, TabTwoActivity.class);
        context.startActivity(intent);
    }

    /**
     * 跳转个人主页
     */
    public static void goPersonPageActivity(Context context, String uuid) {
        GetLoginInfo loginInfoInstance = GetLoginInfo.getLoginInfoInstance(context).readUser();
        String cookieId = loginInfoInstance.getCookieId();
        //    if (!TextUtils.isEmpty(cookieId)) {
        Intent intent = new Intent(context, PersonalPageActivity.class);
        intent.putExtra("uuid", uuid);
        context.startActivity(intent);
//        } else {
//            goLoginActivity(context);
//        }
    }

    /**
     * 跳转到咨询我所页面
     */
    public static void goConsultingOfficeActivity(Context context) {
        Intent it = new Intent(context, ConsultingOfficeActivity.class);
        context.startActivity(it);
    }

    /*
       * 跳转到WebView 页面
       **/
    public static void goWebViewActivity(Context mContext, String title, String uuid, String tag, boolean isUrl) {
        Intent it = new Intent(mContext, WebViewActivity.class);
        it.putExtra("title", title);
        it.putExtra("uuid", uuid);
        it.putExtra("tag", tag);
        it.putExtra("isUrl", isUrl);
        mContext.startActivity(it);
    }

    /*
     * 跳转到事务所商品列表页面
     **/
    public static void goOfficeGoodsListActivity(Context mContext) {
        Intent it = new Intent(mContext, OfficeGoodsListActivity.class);
        mContext.startActivity(it);
    }

    /*
    * 跳转到事务所详情页面
    **/
    public static void goOfficeDetailActivity(Context mContext, String uuid) {
        Intent it = new Intent(mContext, OfficeDetailActivity.class);
        it.putExtra("uuid", uuid);
        mContext.startActivity(it);
    }

    /*
     * 跳转到事务所详情列表页面
     **/
    public static void goOfficeListActivity(Context mContext) {
        Intent it = new Intent(mContext, OfficeListActivity.class);
        mContext.startActivity(it);
    }

    /*
    * 跳转到商品详情页面
    **/
    public static void goGoodsDetailActivity(Context mContext, String uuid) {
        Intent it = new Intent(mContext, GoodsDetailActivity.class);
        it.putExtra("uuid", uuid);
        mContext.startActivity(it);
    }

    /**
     * 跳转到视频列表页面
     **/
    public static void goMediaListActivity(Context mContext, String tag) {
        Intent it = new Intent(mContext, MediaListActivity.class);
        it.putExtra("tag", tag);
        mContext.startActivity(it);
    }

    /**
     * 跳转到政策解读列表页面
     **/
    public static void goCoachListActivity(Context mContext) {
        Intent it = new Intent(mContext, CoachListActivity.class);
        mContext.startActivity(it);
    }

    /**
     * 跳转专家录音列表
     */
    public static void goRecorderListActivity(Context context) {
        Intent it = new Intent(context, RecorderListActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转专家录音详情
     */
    public static void goExpertRecorderDetailActivity(Context context, String uuid) {
        Intent it = new Intent(context, ExpertRecorderDataileActivity.class);
        it.putExtra("uuid", uuid);
        context.startActivity(it);
    }

    /**
     * 跳转专家录音不通过详情
     */
    public static void goRecorderNoPassDetailActivity(Context context, String uuid) {
        Intent it = new Intent(context, RecorderNonPassActivity.class);
        it.putExtra("uuid", uuid);
        context.startActivity(it);
    }

    /**
     * 首发不通过编辑
     */
    public static void goRecorderEditActivity(Activity context, ExpertRecorderDetailModel.DataBean dataBean) {
        Intent it = new Intent(context, RecorderEditActivity.class);
        it.putExtra("bean", dataBean);
        context.startActivityForResult(it, 200);
    }

    /**
     * 补录不通过编辑
     */
    public static void goAdditionalEditActivity(Activity context, ExpertRecorderDetailModel.DataBean dataBean) {
        Intent it = new Intent(context, AdditionalEditActivity.class);
        it.putExtra("bean", dataBean);
        context.startActivityForResult(it, 200);
    }

    /**
     * 跳转专家端录音界面
     * title 录音标题
     * content 录音文本
     * price 追问价格
     * parameter_type 录音类型
     * uuid 类型的uuid
     */
    public static void goRecorderVideoActivity(Activity context, RecorderContentModel model) {
        Intent it = new Intent(context, RecordVideoActivity.class);
        it.putExtra("bean", model);
        context.startActivityForResult(it, 200);
    }

    /**
     * 跳转专家端修改录音界面
     * title 录音标题
     * content 录音文本
     * price 追问价格
     * parameter_type 录音类型
     * uuid 类型的uuid
     */
    public static void goResetRecorderVideoActivity(Activity context, RecorderContentModel model) {
        Intent it = new Intent(context, ResetRecordVideoActivity.class);
        it.putExtra("bean", model);
        context.startActivityForResult(it, 200);
    }

    /**
     * 编辑补录录音页
     */
    public static void goAdditionalEditRecordActivity(Activity activity, RecorderContentModel model) {
        Intent it = new Intent(activity, AdditionalEditRecordActivity.class);
        it.putExtra("bean", model);
        activity.startActivityForResult(it, 200);
    }

    /**
     * 跳转专家端录音界面
     */
    public static void goRecorderContentActivity(Context context) {
        Intent it = new Intent(context, RecorderContentActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转专家端录音类型界面
     */
    public static void goRecorderTypeActivity(Activity context) {
        Intent it = new Intent(context, RecorderTypeActivity.class);
        context.startActivityForResult(it, 200);
    }

    /**
     * 成为365会员
     */
    public static void goToVipActivity(Context context, String vip) {
        GetLoginInfo loginInfoInstance = GetLoginInfo.getLoginInfoInstance(context).readUser();
        String cookieId = loginInfoInstance.getCookieId();
        if (TextUtils.isEmpty(cookieId)) {
//            XToast.showToast(context, "请先登录");
            goLoginActivity(context);
            return;
        }
        Intent intent = new Intent(context, ToVipActivity.class);
        context.startActivity(intent);
    }

    public static void IsVip(Context context) {
        GetLoginInfo loginInfoInstance = GetLoginInfo.getLoginInfoInstance(context).readUser();
        String vip = loginInfoInstance.getVip();
        if (TextUtils.equals("0", vip)) {
            goToVipActivity(context, vip);
        } else if (TextUtils.equals("1", vip)) {
            Intent intent = new Intent(context, MyVipCardBuyActivity.class);
            context.startActivity(intent);
        }
    }

    /**
     * 清单一对一咨询  咨询师身份跳详情
     */
    public static void goNoAnswerActivity(Context context, OneModel.DataBean item) {
        Intent intent = new Intent(context, NoAnswerActivity.class);
        intent.putExtra("item", item);
        context.startActivity(intent);
    }

    /**
     * 清单一对一咨询 跳详情
     */
    public static void goCommonActivity(Context context, OneModel.DataBean item) {
        Intent intent = new Intent(context, CommonActivity.class);
        intent.putExtra("item", item);
        context.startActivity(intent);
    }

    /**
     * 清单快速咨询 咨询师身份跳详情
     */
    public static void goConDetailsActivity(Context context, ConsutationModel.DataBean item) {
        Intent intent = new Intent(context, ConDetailsActivity.class);
        intent.putExtra("item", item);
        context.startActivity(intent);
    }

    /**
     * 清单快速咨询 普通用户身份跳采纳详情
     */
    public static void goAdoptActivity(Context context, ConsutationModel.DataBean item) {
        Intent intent = new Intent(context, AdoptActivity.class);
        intent.putExtra("item", item);
        context.startActivity(intent);
    }

    /**
     * 清单快速咨询 普通用户身份跳未采纳详情
     */
    public static void goNoAdoptActivity(Context context, ConsutationModel.DataBean item) {
        Intent intent = new Intent(context, NoAdoptActivity.class);
        intent.putExtra("item", item);
        context.startActivity(intent);
    }

    /**
     * 跳转到播放视频页面
     **/
    public static void goMediaPlayActivity(Context context, String videoId, String shareUrl, String uuid, String img) {
        Intent it = new Intent(context, MediaPlayerActivity.class);
        it.putExtra("videoId", videoId);
        it.putExtra("share_url", shareUrl);
        it.putExtra("uuid", uuid);
        it.putExtra("img", img);
        context.startActivity(it);
    }

    /**
     * 跳转到直播间页面
     **/
    public static void goLiveDetailActivity(Context context, String liveName) {
        Intent it = new Intent(context, LiveDetailActivity.class);
        it.putExtra("title", liveName);
        context.startActivity(it);
    }

    /**
     * 跳转到补录页面
     **/
    public static void goAdditionalRecorderActivity(Activity context, String uuid, String title, String price) {
        Intent it = new Intent(context, AdditionalRecorderActivity.class);
        it.putExtra("uuid", uuid);
        it.putExtra("title", title);
        it.putExtra("price", price);
        context.startActivityForResult(it, 200);
    }

    /**
     *
     */
    public static void goAnswerTabActivity(Context context) {
        Intent it = new Intent(context, AnswerTabActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转地区筛选页
     */
    public static void goAreaIdActivity(Context context) {
        Intent it = new Intent(context, AreaIdActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转到大咖访谈列表
     */
    public static void goInterviewListActivity(Context context) {
        Intent it = new Intent(context, InterviewListActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转到钱包
     */
    public static void goBalanceActivity(Context context) {
        Intent it = new Intent(context, BalanceActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转到交易记录
     */
    public static void goDealActivity(Context context) {
        Intent it = new Intent(context, DealActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转已购视频
     */
    public static void goBuyMediaListActivity(Context context) {
        Intent it = new Intent(context, BuyMediaListActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转菜单展示页
     */
    public static void goMenuShowActivity(Context context, String tag) {
        Intent it = new Intent(context, MenuTagActivity.class);
        it.putExtra("tag", tag);
        context.startActivity(it);
    }

    /**
     * 跳转菜单搜索页
     */
    public static void goMenuTagResultAcitivty(Context context, String name, String type, String uuid) {
        Intent it = new Intent(context, MenuTagResultActivity.class);
        it.putExtra("name", name);
        it.putExtra("type", type);
        it.putExtra("uuid", uuid);
        context.startActivity(it);
    }

    /**
     * 跳转到文档选择页面
     *
     * @param filters 过滤文件类型
     **/
    public static void goFilePickerActivity(Activity context, String[] filters) {
        Intent intent = new Intent(context, FilePickerActivity.class);
        intent.putExtra("filters", filters);
        context.startActivityForResult(intent, FilePickerActivity.FILE_RESULT_CODE);
    }

    /**
     * 跳转申请答疑专家详情
     */
    public static void goApplyToExpertTwoActivity(Context context) {
        Intent intent = new Intent(context, ApplyToExpertTwoActivity.class);
        context.startActivity(intent);
    }

    /**
     * 跳转关于我们
     */
    public static void goAboutUsActivity(Context context) {
        Intent intent = new Intent(context, AboutUsActivity.class);
        context.startActivity(intent);
    }

    /**
     * 我的收藏
     */
    public static void goMyFavoriteActivity(Context context) {
        Intent intent = new Intent(context, MyFavoriteActivity.class);
        context.startActivity(intent);
    }

    /**
     * 跳转提现页面
     */
    public static void goWithdrawalsActivity(Context context) {
        Intent intent = new Intent(context, WithdrawalsActivity.class);
        context.startActivity(intent);
    }

    /**
     * 搜索查看更多内容
     */
    public static void goMoreResultActivity(Context context, String key, String title, String tag) {
        Intent intent = new Intent(context, MoreResultActivity.class);
        intent.putExtra("key", key);
        intent.putExtra("title", title);
        intent.putExtra("tag", tag);
        context.startActivity(intent);
    }

    /**
     * 跳转提现记录
     */
    public static void goCashListActivity(Context context) {
        Intent intent = new Intent(context, CashListActivity.class);
        context.startActivity(intent);
    }

    /**
     * 跳帮助页面
     */
    public static void goHelpActivity(Context context) {
        Intent intent = new Intent(context, HelpActivity.class);
        context.startActivity(intent);
    }

    /**
     * 跳帮助详情页面
     */
    public static void goHelpDetailActivity(Context context) {
        Intent intent = new Intent(context, HelpDetailActivity.class);
        context.startActivity(intent);
    }

    /**
     * 技能大赛跳登记页面
     */
    public static void goCheckInActivity(Context context) {
        Intent intent = new Intent(context, CheckInActivity.class);
        context.startActivity(intent);
    }

    /**
     * 技能大赛跳登记页面
     */
    public static void goCheckOkActivity(Context context) {
        Intent intent = new Intent(context, CheckOkActivity.class);
        context.startActivity(intent);
    }

    /**
     * 技能大赛简介
     */
    public static void goMacthActivity(Context context) {
        Intent intent = new Intent(context, MatchActivity.class);
        context.startActivity(intent);
    }


    /**
     * 跳转到技能大赛列表页面
     */
    public static void goEventListActivity(Context context) {
        Intent intent = new Intent(context, EventListActivity.class);
        context.startActivity(intent);
    }

    /**
     * 跳转到竞赛播放视频页面
     **/
    public static void goEventMediaPlayActivity(Context context, String videoId, String id, String shareUrl, String img) {
        Intent it = new Intent(context, EventMediaPlayerActivity.class);
        it.putExtra("videoId", videoId);
        it.putExtra("id", id);
        it.putExtra("share_url", shareUrl);
        it.putExtra("img", img);
        context.startActivity(it);
    }

    /**
     * 跳修改密码
     */
    public static void goUpPasswordActivity(Context context) {
        Intent intent = new Intent(context, UpPasswordActivity.class);
        context.startActivity(intent);
    }

    /**
     * 跳设置界面
     */
    public static void goSettingActivity(Context context) {
        Intent intent = new Intent(context, SettingActivity.class);
        context.startActivity(intent);
    }

    /**
     * 跳转到发送快速咨询页面
     */
    public static void goQuickConsultationActivity(Context context) {
        Intent intent1 = new Intent(context, QuickConsultationActivity.class);
        context.startActivity(intent1);
    }

    /**
     * 我的会员卡界面
     */
    public static void goMyVipCardActivity(Context context) {
        Intent intent = new Intent(context, MyVipCardActivity.class);
        context.startActivity(intent);
    }

    /**
     * 跳一对一咨询（事务所+平台普通用户）
     */
    public static void goSpecialConsultActivity(Context context) {
        Intent intent = new Intent(context, SpeciaConsultActivity.class);
        context.startActivity(intent);
    }

    /**
     * 跳邀请会员界面
     */
    public static void goInviteMembersActivity(Context context) {
        Intent intent = new Intent(context, InviteMembersActivity.class);
        context.startActivity(intent);
    }

    /**
     * 邀请二维码
     */
    public static void goInviteCodeActivity(Context context) {
        Intent intent = new Intent(context, InvitCodeActivity.class);
        context.startActivity(intent);
    }

    /**
     * 待回答列表
     */
    public static void goToAnswerListActivity(Context context) {
        Intent intent = new Intent(context, ToAnswerListActivity.class);
        context.startActivity(intent);
    }

    /**
     * 跳引导页
     */
    public static void goGuidPagerAcitivty(Context context) {
        Intent intent = new Intent(context, GuidePageActivity.class);
        context.startActivity(intent);
    }

    /**
     * 跳知识库
     */
    public static void goKnowledgeAcitivty(Context context) {
        Intent intent = new Intent(context, KnowledgeActivity.class);
        context.startActivity(intent);
    }

    /**
     * 跳数据搜索页
     * tag  知识库repository     案例库case
     */
    public static void goDataQueryActivity(Context context, String tag) {
        Intent intent = new Intent(context, DataQueryActivity.class);
        intent.putExtra("tag", tag);
        context.startActivity(intent);
    }

    /**
     * 跳案例库
     */
    public static void goCaseAcitivty(Context context) {
        Intent intent = new Intent(context, CaseActivity.class);
        context.startActivity(intent);
    }

    /**
     * 跳搜索结果页
     */
    public static void goDataQueryListActivity(Context context, String content, String tag) {
        Intent intent = new Intent(context, DataQueryListActivity.class);
        intent.putExtra("content", content);
        intent.putExtra("tag", tag);
        context.startActivity(intent);
    }

    /**
     * 跳案例库 知识库详情
     * flag 区分知识库和案例库 跳转到详情页面
     */
    public static void goKnowledgeDetailsAcitivty(Context context, String uuid, int flag) {
        Intent intent = new Intent(context, KnowledgeDetailsActivity.class);
        intent.putExtra("uuid", uuid);
        intent.putExtra("flag", flag);
        context.startActivity(intent);
    }

    /**
     * 跳4库查看更多
     */
    public static void goMoreDataQueryActivity(Context context, String content, String title, String tag, String type) {
        Intent intent = new Intent(context, MoreDataQueryActivity.class);
        intent.putExtra("content", content);
        intent.putExtra("title", title);
        intent.putExtra("tag", tag);
        intent.putExtra("type", type);
        context.startActivity(intent);
    }

    /**
     * 跳转到工具库
     */
    public static void goToolsActivity(Context context) {
        Intent it = new Intent(context, ToolsActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转到计算器
     */
    public static void goCounterActivity(Context context) {
        Intent it = new Intent(context, CounterActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转到会计速查
     */
    public static void goAccountantSearchActivity(Context context) {
        Intent it = new Intent(context, AccountantSearchActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转到日历
     */
    public static void goCalendarActivity(Context context) {
        Intent it = new Intent(context, CalendarActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转到税率速查
     */
    public static void goTaxSearchActivity(Context context) {
        Intent it = new Intent(context, TaxSearchActivity.class);
        context.startActivity(it);
    }


    /**
     * 跳转到会计速查详情
     */
    public static void goAccountantDetailActivity(Context context, int id) {
        Intent it = new Intent(context, AccountantDetailActivity.class);
        it.putExtra("id", id);
        context.startActivity(it);
    }

    /**
     * 跳转到会计速查详情
     */
    public static void goTaxSearchDetailActivity(Context context, String title, String url) {
        Intent it = new Intent(context, TaxSearchDetailActivity.class);
        it.putExtra("title", title);
        it.putExtra("url", url);
        context.startActivity(it);
    }

    /**
     * 跳转到修改个人资料
     */
    public static void goPersonalDataActivity(Context context, String name, String imgName, String phoneNumber) {
        Intent it = new Intent(context, PersonalDataActivity.class);
        if (!TextUtils.isEmpty(name)) {
            it.putExtra("name", name);
        } else {
            it.putExtra("name", phoneNumber);
        }
        it.putExtra("imgName", imgName);
        context.startActivity(it);
    }

    /*
     * 跳转到消息列表
     */
    public static void goSystemInformationActivity(Context context) {
        Intent it = new Intent(context, SystemInformationActivity.class);
        context.startActivity(it);
    }

    /*
     * 跳转到修改手机号
     */
    public static void goChangePhoneActivity(Context context) {
        Intent it = new Intent(context, ChangePhoneActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转到消息列表
     */
    public static void goInviteRecordActivity(Context context) {
        Intent it = new Intent(context, InviteRecordActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转到搜索咨询师页
     */
    public static void goSearchPersonActivity(Context context) {
        Intent it = new Intent(context, SearchPersonActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转到搜索专家答疑页
     */
    public static void goSearchVoiceActivity(Context context) {
        Intent it = new Intent(context, SearchVoiceActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转到系统消息详情
     */
    public static void goSystemInformationDetailsActivity(Context context, int id) {
        Intent it = new Intent(context, SystemIformationDetailsActivity.class);
        it.putExtra("id", id);
        context.startActivity(it);
    }

    /**
     * 跳转到下载详情页面
     */
    public static void goDownloadListActivity(Context context) {
        Intent it = new Intent(context, DownloadListActivity.class);
        context.startActivity(it);
    }
}
